{template header}
<style>
    td{
        font-size: 14px;
    }
</style>
<a class="btn btn-info" href="?c=admin&a=actHandle">添加官方活动</a>
<a class="btn btn-info" href="?c=admin&a=groupActHandle">发布群组活动</a>
<a class="btn btn-info" href="?c=admin&a=GroupActivity">官方活动</a>
<a class="btn btn-info" href="?c=admin&a=GroupActivity&type=1">非官方活动</a>
<a class="btn btn-info" href="?c=admin&a=recommendActList">已推荐活动</a>
{if $atype==1}
<h4 style="padding-left:10px;;">搜索 <i class="icon-search"></i></h4>
<form class="form-horizontal clearfix form-inline" method="post" action="">
    <div class="control-group search-group">
        <label class="control-label" >活动名/ID：</label>
        <div class="controls">
            <input type="text" placeholder="请输入活动名称或ID" name="act" value="{$act}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >群名/ID：</label>
        <div class="controls">
            <input type="text" placeholder="请输入群名称或ID" name="group" value="{$group}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >活动类型：</label>
        <div class="controls">
            <select name="actType">
                <option value="-1" >全部</option>
                <option value="0" {if $actType==0}selected{/if}>自定义活动</option>
                <option value="1" {if $actType==1}selected{/if}>目标里程</option>
                <option value="2" {if $actType==2}selected{/if}>目标打卡</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >是否免费：</label>
        <div class="controls">
            <select name="free">
                <option value="0">全部</option>
                <option value="1">是</option>
                <option value="2">否</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <div class="controls">
            <button class="btn" type="submit">提交</button>　
            <button class="btn" type="reset">重置</button>
        </div>
    </div>
</form>
{/if}
<div class="bs-docs-example table-align pt-15" style="clear:both;">
    <table class="table table-striped table-align">
        <thead>
        <tr>
            {if $atype == 1}
            <th>所属组</th>
            <th>发布者</th>
            {/if}
            <th width="15%">活动名称</th>
            <th>活动类型</th>
            <th>创建时间</th>
            <th>开始时间</th>
            <th>结束时间</th>
            <th>费用</th>
            <th>参加人数</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {loop $list $k $v}
        <tr>
            {if $atype == 1}
            <td>{if ($v['gid'] > 0)}<a href="?c=admin&a=GroupStatistic&gid={$v['gid']}">{$v['gid']}</a>{else}{$v['gid']}{/if}</td>
            <td>{$v['name']}</td>
            {/if}
            <td>{$v['title']}</td>
            <td>{eval echo $type[$v['type']]}</td>
            <td>{eval echo date("Y-m-d H:i:s",$v['addtime'])}</td>
            <td>{eval echo date("Y-m-d H:i:s",$v['stime'])}</td>
            <td>{eval echo date("Y-m-d H:i:s",$v['etime'])}</td>
            <td>{eval echo floatval($v['cost'])}元</td>
            <td>{$v['joinNum']}</td>
            <td>{eval echo $status[$v['status']]}</td>
            <td>
                <a class="btn btn-primary" id="btn" href="?c=admin&a=actHandle&action=edit&id={$v['aid']}">{if $atype==0}编辑{else}查看{/if}</a>
                <a class="btn btn-primary" id="btn" href="?c=admin&a=addActComment&id={$v['aid']}&type={$atype}">加评</a>
                <a class="btn btn-primary" id="btn" href="?c=admin&a=joinsList&aid={$v['aid']}&gid={$v['gid']}">参与者</a>
                {if $atype == 1}

                    {if $v['flag'] == 0}
                        <a class="btn btn-primary" id="btn" href="?c=admin&a=actRecommend&id={$v['aid']}">推荐</a>
                    {else}
                        <a class="btn btn-primary" id="btn" href="?c=admin&a=actRecommend&id={$v['aid']}">取消推荐</a>
                    {/if}
                {/if}
                {if $atype == 0}
                <a class="btn btn-primary" id="btn" href="?c=admin&a=actGroup&id={$v['aid']}">群组列表</a>
                {/if}
                <a class="btn btn-primary" id="btn" href="?c=admin&a=actComment&id={$v['aid']}">查看评论</a>
                {if $v['type'] == 1 || $v['type'] == 2}
                <a class="btn btn-primary" target="_blank" href="/show/statistics?aid={$v['aid']}&gid={$v['gid']}">活动统计</a>
                {/if}
                <a class="btn btn-primary"  href="/admin/actHandle?action=del&aid={$v['aid']}&gid={$v['gid']}">删除（无用）</a>
            </td>
        </tr>

        {/loop}
        </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>
{template footer}
